<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="PersonalPage.css" />
</head>
<%@page import="entities.*"%>
<%@page import="java.util.*"%>
<%
	RegisteredUser user = (RegisteredUser) request.getSession()
			.getAttribute("user");
	List<PendingFriendship> pendingList = (List<PendingFriendship>) request
			.getSession().getAttribute("pendingfriendship");
%>
<body style="background-color: #94C0D6">
	<img alt="" src="Swim.jpg" style="height: 64px; width: 200px;">
	<form
		style="background-color: #A6B0DB; border-bottom-width: thin; border-right-width: thin; border-left-width: thin; border-top-width: thin; border-top-color: #8080FF; border-right-color: #8080FF; border-top-style: solid; border-right-style: solid; height: 24px;">
		<a href="SearchServlet">Back.</a> <a href="LogOutServlet">Logout.</a>
	</form>
<form style="width: 453px; background-color: #8080FF; height: 22px; vertical-align: middle; border-top-style: solid; border-top-color: #8080C0; border-right-color: #8080C0; border-right-width: thin; border-right-style: solid; border-top-width: thin">
			<center><b><%
				out.print(user.getSurname() + " " + user.getName() + " (alias "
						+ user.getUserId() + ")");
			%></b></center>
</form>
<br>
<br>
<br>
<fieldset style="width: 995px; background-color: #A6B0DB">
		<div class=field style="width: 276px;">
			<form style="height: 164px; width: 183px; background-color: #A6B0DB; border-top-style: solid; border-top-color: #8080FF; border-right-color: #8080FF; border-right-style: none; border-left-color: #8080FF; border-left-style: solid; border-left-width: thin; border-bottom-color: #8080FF; border-top-width: thin">

				<a href="UpdatePersonalInformation.jsp"><br> Edit Personal
					Info <br></a> 
					<a href="NotificationServlet">View Notifications <br> </a> 
					<a href="SuggestionsServlet">View Friend Suggestions <br></a> 
					<a href="PendingFriendshipServlet">View Friendship Requests <br></a>
				<a href="PendingHelpServlet">View Help Requests <br></a>
								<a href="RequestAbilityServlet">Request New Ability <br></a>
			</form>
		</div>
		<div class="field" style="width: 276px;">
			<b>Pending Friendship</b>
			<form class="form-inside"
				style="width: 933px; height: 222px; list-style-type: disc" action="">
				<br>
				<table border="1" cellspacing="0" cellpadding="5" style="background-color: #8080C0">
					 <tr>
					 <td style="background-color: #8080FF;"> Sender </td>
					 </tr>
					<%
						for (PendingFriendship pending : pendingList) {
							RegisteredUser sender = pending.getKey().getSender();
							out.println("<tr><td>");
							out.println("<a href=\"ProfileServlet?user=" + sender.getUserId() + "\">" + sender.getSurname() + " " + sender.getName() + "</a></td>");
							out.println("<td style=\"background-color: #8080FF;\"><a href=\"ManageFriendshipServlet?outcome=accepted&&friend=" + pending.getKey().getSender().getUserId() + "\">Accept <br> </a></td>");
							out.println("<td style=\"background-color: #8080FF;\"><a href=\"ManageFriendshipServlet?outcome=refused&&friend=" + pending.getKey().getSender().getUserId() + "\">Refuse <br> </a></td></tr>");
						}
					%>
				</table>
			</form>
		</div>
	</fieldset>
</body>
</html>

